Skip to content

Use Imagick methods instead of mogrify() for repo theme images - #2375

Merged
sbreker merged 2 commits into
qa/2.xfrom
dev/repo-logo-use-imagick
Aug 12, 2026
Merged

Use Imagick methods instead of mogrify() for repo theme images#2375
sbreker merged 2 commits into
qa/2.xfrom
dev/repo-logo-use-imagick

Conversation

@sbreker

@sbreker sbreker commented Jun 27, 2026

Copy link
Copy Markdown
Member

Refactored class arRepositoryThemeCropValidatedFile to use Imagick methods instead of mogrify command.

Replace the previous crop-only behavior with resize-and-crop processing for repository logo and banner uploads. Images are now scaled to cover the target dimensions while preserving aspect ratio, then center-cropped to the final logo or banner size. This keeps uploaded assets small after processing and avoids squashing non-square source images. Also increased the allowed upload size from 256K to 500K to give users more room to upload larger source images before resize and crop.

Set Imagick memory, map, and pixel-area limits before reading repository logo and banner uploads.

@sbreker
sbreker force-pushed the dev/repo-logo-use-imagick branch 3 times, most recently from 8dc8e44 to 3869a0a Compare June 27, 2026 01:28
Comment on lines +97 to +100
protected function shouldCropImages()
{
return extension_loaded('imagick');
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of defining this method, could we just re-use QubitDigitalObject::imagickExtensionLoaded since that is a static method?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea - I have updated this to use the static method 👍

@sbreker
sbreker force-pushed the dev/repo-logo-use-imagick branch from 3869a0a to 333640d Compare July 16, 2026 22:28
@sbreker
sbreker requested a review from anvit July 16, 2026 22:37
@anvit anvit added this to the 2.11 milestone Aug 12, 2026
@anvit anvit added the Type: enhancement An improvement to existing functionality. label Aug 12, 2026
Refactored class arRepositoryThemeCropValidatedFile to use Imagick
methods instead of mogrify() command.
Replace the previous crop-only behavior with resize-and-crop processing
for repository logo and banner uploads. Images are now scaled to cover
the target dimensions while preserving aspect ratio, then center-cropped
to the final logo or banner size.

This keeps uploaded assets small after processing and avoids squashing
non-square source images.

Also increased the allowed upload size from 256K to 500K to give users
more room to upload larger source images before resize and crop.

Set Imagick memory, map, and pixel-area limits before reading
repository logo and banner uploads.
@sbreker
sbreker force-pushed the dev/repo-logo-use-imagick branch from a484528 to 8b09994 Compare August 12, 2026 23:16
@sbreker
sbreker merged commit 8b09994 into qa/2.x Aug 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: enhancement An improvement to existing functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants